import request from '../../api/base'

export function listEmployeeOverWork(date) {
  let data = {pageSize: 100, pageNum: 1, date};
  return  request({
    method: 'get',
    url: 'api/member/api-member/employeeOverwork/listEmployeeOverWork',
    data: data,
  }).then(res => {
    if (res.flag){
      return res.data
    }
    return [];
  })
}

export function deleteOverWorkById(id) {
  return  request({
    method: 'delete',
    url: 'api/member/api-member/employeeOverwork/deleteOverWorkById',
    data: {id},
    requestType: 'form'
  }).then(res => res)
}

export function getOvertimeHours(data) {
  return new Promise((resolve, reject)=>{
    return resolve(2);
  });
  /*return  request({
    method: 'post',
    url: '',
    data: {...data},
  }).then(res => {
    if (res.flag){
      return res.data
    }
  })*/
}

export function saveOverWork(data) {
  return  request({
    method: 'post',
    url: 'api/member/api-member/employeeOverwork/saveOverWork',
    data: data,
  }).then(res => res)
}
